import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { SongSheet } from '@services/data-types/common.type';

@Component({
  selector: 'app-song-sheet',
  templateUrl: './song-sheet.component.html',
  styleUrls: ['./song-sheet.component.less']
})

export class SongSheetComponent implements OnInit {
  @Input() sheetItem: SongSheet;
  @Output() onPlay = new EventEmitter<number>();
  constructor() { }

  ngOnInit() {
  }
  get coverImg(): string {
    return this.sheetItem.picUrl || this.sheetItem.coverImgUrl;
  }
  playSongSheet(ev: MouseEvent, id: number) {
    ev.stopPropagation();
    this.onPlay.emit(id);
  }
}
